﻿using Microsoft.AspNetCore.Mvc;
using SD.Infrastructure.DTOBase;
using SD.Toolkits.AspNetCore.Attributes;
using SlamDunk.MES.IAppService.DTOs.Inputs;
using SlamDunk.MES.IAppService.DTOs.Outputs.PlanContext;
using SlamDunk.MES.IAppService.Interfaces;
using SlamDunk.ValueObjects.Enums;
using System;
using System.Collections.Generic;

namespace SlamDunk.MES.AppService.Host.Controllers
{
    /// <summary>
    /// 计划管理服务WebApi接口
    /// </summary>
    [ApiController]
    [Route("Api/[controller]/[action]")]
    public class PlanController : ControllerBase
    {
        #region # 字段及构造器

        /// <summary>
        /// 计划管理服务契约接口
        /// </summary>
        private readonly IPlanContract _planContract;

        /// <summary>
        /// 依赖注入构造器
        /// </summary>
        public PlanController(IPlanContract planContract)
        {
            this._planContract = planContract;
        }

        #endregion


        //命令部分

        #region # 创建销售订单 —— void CreateSaleOrder(string orderNo, string orderName...
        /// <summary>
        /// 创建销售订单
        /// </summary>
        /// <param name="orderNo">销售订单编号</param>
        /// <param name="orderName">销售订单名称</param>
        /// <param name="customerId">客户Id</param>
        /// <param name="issuedDate">下单日期</param>
        /// <param name="deliveryDate">交付日期</param>
        /// <param name="description">描述</param>
        /// <param name="detailParams">销售订单明细参数模型集</param>
        [HttpPost]
        [WrapPostParameters]
        public void CreateSaleOrder(string orderNo, string orderName, Guid customerId, DateTime issuedDate, DateTime deliveryDate, string description, IEnumerable<SaleOrderDetailParam> detailParams)
        {
            this._planContract.CreateSaleOrder(orderNo, orderName, customerId, issuedDate, deliveryDate, description, detailParams);
        }
        #endregion

        #region # 修改销售订单 —— void UpdateSaleOrder(Guid saleOrderId, string orderName...
        /// <summary>
        /// 修改销售订单
        /// </summary>
        /// <param name="saleOrderId">销售订单Id</param>
        /// <param name="orderName">销售订单名称</param>
        /// <param name="customerId">客户Id</param>
        /// <param name="issuedDate">下单日期</param>
        /// <param name="deliveryDate">交付日期</param>
        /// <param name="description">描述</param>
        /// <param name="detailParams">销售订单明细参数模型集</param>
        [HttpPost]
        [WrapPostParameters]
        public void UpdateSaleOrder(Guid saleOrderId, string orderName, Guid customerId, DateTime issuedDate, DateTime deliveryDate, string description, IEnumerable<SaleOrderDetailParam> detailParams)
        {
            this._planContract.UpdateSaleOrder(saleOrderId, orderName, customerId, issuedDate, deliveryDate, description, detailParams);
        }
        #endregion

        #region # 删除销售订单 —— void RemoveSaleOrder(Guid saleOrderId)
        /// <summary>
        /// 删除销售订单
        /// </summary>
        /// <param name="saleOrderId">销售订单Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void RemoveSaleOrder(Guid saleOrderId)
        {
            this._planContract.RemoveSaleOrder(saleOrderId);
        }
        #endregion

        #region # 提交审核销售订单 —— void SubmitSaleOrder(Guid saleOrderId)
        /// <summary>
        /// 提交审核销售订单
        /// </summary>
        /// <param name="saleOrderId">销售订单Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void SubmitSaleOrder(Guid saleOrderId)
        {
            this._planContract.SubmitSaleOrder(saleOrderId);
        }
        #endregion

        #region # 批量提交审核销售订单 —— void SubmitSaleOrders(IEnumerable<Guid>...
        /// <summary>
        /// 批量提交审核销售订单
        /// </summary>
        /// <param name="saleOrderIds">销售订单Id集</param>
        [HttpPost]
        [WrapPostParameters]
        public void SubmitSaleOrders(IEnumerable<Guid> saleOrderIds)
        {
            this._planContract.SubmitSaleOrders(saleOrderIds);
        }
        #endregion

        #region # 审核销售订单 —— void CheckSaleOrder(Guid saleOrderId...
        /// <summary>
        /// 审核销售订单
        /// </summary>
        /// <param name="saleOrderId">销售订单Id</param>
        /// <param name="passed">是否通过</param>
        /// <param name="checkedRemark">审核意见</param>
        [HttpPost]
        [WrapPostParameters]
        public void CheckSaleOrder(Guid saleOrderId, bool passed, string checkedRemark)
        {
            this._planContract.CheckSaleOrder(saleOrderId, passed, checkedRemark);
        }
        #endregion

        #region # 创建生产计划 —— void CreateProductionPlan(string planNo, string planName...
        /// <summary>
        /// 创建生产计划
        /// </summary>
        /// <param name="planNo">生产计划编号</param>
        /// <param name="planName">生产计划名称</param>
        /// <param name="productionBatchNo">生产批号</param>
        /// <param name="expStartTime">预期开始时间</param>
        /// <param name="expEndTime">预期结束时间</param>
        /// <param name="earliestStartTime">最早开始时间</param>
        /// <param name="latestEndTime">最晚结束时间</param>
        /// <param name="productId">产品Id</param>
        /// <param name="bomId">物料清单Id</param>
        /// <param name="expGrossQuantity">预期毛产量</param>
        /// <param name="expNetQuantity">预期净产量</param>
        /// <param name="saleOrderId">销售订单Id</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="priority">优先级</param>
        /// <param name="description">描述</param>
        [HttpPost]
        [WrapPostParameters]
        public void CreateProductionPlan(string planNo, string planName, string productionBatchNo, DateTime expStartTime, DateTime expEndTime, DateTime earliestStartTime, DateTime latestEndTime, Guid productId, Guid bomId, decimal expGrossQuantity, decimal expNetQuantity, Guid? saleOrderId, Guid? facilityId, int priority, string description)
        {
            this._planContract.CreateProductionPlan(planNo, planName, productionBatchNo, expStartTime, expEndTime, earliestStartTime, latestEndTime, productId, bomId, expGrossQuantity, expNetQuantity, saleOrderId, facilityId, priority, description);
        }
        #endregion

        #region # 修改生产计划 —— void UpdateProductionPlan(Guid productionPlanId, string planName...
        /// <summary>
        /// 修改生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="planName">生产计划名称</param>
        /// <param name="productionBatchNo">生产批号</param>
        /// <param name="expStartTime">预期开始时间</param>
        /// <param name="expEndTime">预期结束时间</param>
        /// <param name="earliestStartTime">最早开始时间</param>
        /// <param name="latestEndTime">最晚结束时间</param>
        /// <param name="productId">产品Id</param>
        /// <param name="bomId">物料清单Id</param>
        /// <param name="expGrossQuantity">预期毛产量</param>
        /// <param name="expNetQuantity">预期净产量</param>
        /// <param name="saleOrderId">销售订单Id</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="priority">优先级</param>
        /// <param name="description">描述</param>
        [HttpPost]
        [WrapPostParameters]
        public void UpdateProductionPlan(Guid productionPlanId, string planName, string productionBatchNo, DateTime expStartTime, DateTime expEndTime, DateTime earliestStartTime, DateTime latestEndTime, Guid productId, Guid bomId, decimal expGrossQuantity, decimal expNetQuantity, Guid? saleOrderId, Guid? facilityId, int priority, string description)
        {
            this._planContract.UpdateProductionPlan(productionPlanId, planName, productionBatchNo, expStartTime, expEndTime, earliestStartTime, latestEndTime, productId, bomId, expGrossQuantity, expNetQuantity, saleOrderId, facilityId, priority, description);
        }
        #endregion

        #region # 删除生产计划 —— void RemoveProductionPlan(Guid productionPlanId)
        /// <summary>
        /// 删除生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void RemoveProductionPlan(Guid productionPlanId)
        {
            this._planContract.RemoveProductionPlan(productionPlanId);
        }
        #endregion

        #region # 设置生产物料需求 —— void SetProductionMaterialAsks(Guid productionPlanId...
        /// <summary>
        /// 设置生产物料需求
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="materialAskParams">生产物料需求参数模型集</param>
        [HttpPost]
        [WrapPostParameters]
        public void SetProductionMaterialAsks(Guid productionPlanId, IEnumerable<ProductionMaterialAskParam> materialAskParams)
        {
            this._planContract.SetProductionMaterialAsks(productionPlanId, materialAskParams);
        }
        #endregion

        #region # 提交审核生产计划 —— void SubmitProductionPlan(Guid productionPlanId)
        /// <summary>
        /// 提交审核生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void SubmitProductionPlan(Guid productionPlanId)
        {
            this._planContract.SubmitProductionPlan(productionPlanId);
        }
        #endregion

        #region # 批量提交审核生产计划 —— void SubmitProductionPlans(IEnumerable<Guid>...
        /// <summary>
        /// 批量提交审核生产计划
        /// </summary>
        /// <param name="productionPlanIds">生产计划Id集</param>
        [HttpPost]
        [WrapPostParameters]
        public void SubmitProductionPlans(IEnumerable<Guid> productionPlanIds)
        {
            this._planContract.SubmitProductionPlans(productionPlanIds);
        }
        #endregion

        #region # 审核生产计划 —— void CheckProductionPlan(Guid productionPlanId...
        /// <summary>
        /// 审核生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="passed">是否通过</param>
        /// <param name="checkedRemark">审核意见</param>
        [HttpPost]
        [WrapPostParameters]
        public void CheckProductionPlan(Guid productionPlanId, bool passed, string checkedRemark)
        {
            this._planContract.CheckProductionPlan(productionPlanId, passed, checkedRemark);
        }
        #endregion

        #region # 发布生产计划 —— void ReleaseProductionPlan(Guid productionPlanId)
        /// <summary>
        /// 发布生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void ReleaseProductionPlan(Guid productionPlanId)
        {
            this._planContract.ReleaseProductionPlan(productionPlanId);
        }
        #endregion

        #region # 取消生产计划 —— void CancelProductionPlan(Guid productionPlanId...
        /// <summary>
        /// 取消生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="reason">取消原因</param>
        [HttpPost]
        [WrapPostParameters]
        public void CancelProductionPlan(Guid productionPlanId, string reason)
        {
            this._planContract.CancelProductionPlan(productionPlanId, reason);
        }
        #endregion

        #region # 执行生产计划 —— void ExecuteProductionPlan(Guid productionPlanId)
        /// <summary>
        /// 执行生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void ExecuteProductionPlan(Guid productionPlanId)
        {
            this._planContract.ExecuteProductionPlan(productionPlanId);
        }
        #endregion

        #region # 中止生产计划 —— void AbortProductionPlan(Guid productionPlanId...
        /// <summary>
        /// 中止生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="reason">中止原因</param>
        [HttpPost]
        [WrapPostParameters]
        public void AbortProductionPlan(Guid productionPlanId, string reason)
        {
            this._planContract.AbortProductionPlan(productionPlanId, reason);
        }
        #endregion

        #region # 完成生产计划 —— void CompleteProductionPlan(Guid productionPlanId)
        /// <summary>
        /// 完成生产计划
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void CompleteProductionPlan(Guid productionPlanId)
        {
            this._planContract.CompleteProductionPlan(productionPlanId);
        }
        #endregion

        #region # 创建作业计划 —— void CreateExecutionPlan(string planNo, string planName...
        /// <summary>
        /// 创建作业计划
        /// </summary>
        /// <param name="planNo">作业计划编号</param>
        /// <param name="planName">作业计划名称</param>
        /// <param name="productionBatchNo">生产批号</param>
        /// <param name="expStartTime">预期开始时间</param>
        /// <param name="expEndTime">预期结束时间</param>
        /// <param name="earliestStartTime">最早开始时间</param>
        /// <param name="latestEndTime">最晚结束时间</param>
        /// <param name="productId">产品Id</param>
        /// <param name="processId">工艺Id</param>
        /// <param name="bomId">物料清单Id</param>
        /// <param name="expGrossQuantity">预期毛产量</param>
        /// <param name="expNetQuantity">预期净产量</param>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="priority">优先级</param>
        /// <param name="description">描述</param>
        [HttpPost]
        [WrapPostParameters]
        public void CreateExecutionPlan(string planNo, string planName, string productionBatchNo, DateTime expStartTime, DateTime expEndTime, DateTime earliestStartTime, DateTime latestEndTime, Guid productId, Guid processId, Guid bomId, decimal expGrossQuantity, decimal expNetQuantity, Guid? productionPlanId, Guid? facilityId, int priority, string description)
        {
            this._planContract.CreateExecutionPlan(planNo, planName, productionBatchNo, expStartTime, expEndTime, earliestStartTime, latestEndTime, productId, processId, bomId, expGrossQuantity, expNetQuantity, productionPlanId, facilityId, priority, description);
        }
        #endregion

        #region # 修改作业计划 —— void UpdateExecutionPlan(Guid executionPlanId, string planName...
        /// <summary>
        /// 修改作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="planName">作业计划名称</param>
        /// <param name="productionBatchNo">生产批号</param>
        /// <param name="expStartTime">预期开始时间</param>
        /// <param name="expEndTime">预期结束时间</param>
        /// <param name="earliestStartTime">最早开始时间</param>
        /// <param name="latestEndTime">最晚结束时间</param>
        /// <param name="productId">产品Id</param>
        /// <param name="processId">工艺Id</param>
        /// <param name="bomId">物料清单Id</param>
        /// <param name="expGrossQuantity">预期毛产量</param>
        /// <param name="expNetQuantity">预期净产量</param>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="priority">优先级</param>
        /// <param name="description">描述</param>
        [HttpPost]
        [WrapPostParameters]
        public void UpdateExecutionPlan(Guid executionPlanId, string planName, string productionBatchNo, DateTime expStartTime, DateTime expEndTime, DateTime earliestStartTime, DateTime latestEndTime, Guid productId, Guid processId, Guid bomId, decimal expGrossQuantity, decimal expNetQuantity, Guid? productionPlanId, Guid? facilityId, int priority, string description)
        {
            this._planContract.UpdateExecutionPlan(executionPlanId, planName, productionBatchNo, expStartTime, expEndTime, earliestStartTime, latestEndTime, productId, processId, bomId, expGrossQuantity, expNetQuantity, productionPlanId, facilityId, priority, description);
        }
        #endregion

        #region # 删除作业计划 —— void RemoveExecutionPlan(Guid executionPlanId)
        /// <summary>
        /// 删除作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void RemoveExecutionPlan(Guid executionPlanId)
        {
            this._planContract.RemoveExecutionPlan(executionPlanId);
        }
        #endregion

        #region # 设置作业物料需求 —— void SetExecutionMaterialAsks(Guid executionPlanId...
        /// <summary>
        /// 设置作业物料需求
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="materialAskParams">作业物料需求参数模型集</param>
        [HttpPost]
        [WrapPostParameters]
        public void SetExecutionMaterialAsks(Guid executionPlanId, IEnumerable<ExecutionMaterialAskParam> materialAskParams)
        {
            this._planContract.SetExecutionMaterialAsks(executionPlanId, materialAskParams);
        }
        #endregion

        #region # 提交审核作业计划 —— void SubmitExecutionPlan(Guid executionPlanId)
        /// <summary>
        /// 提交审核作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void SubmitExecutionPlan(Guid executionPlanId)
        {
            this._planContract.SubmitExecutionPlan(executionPlanId);
        }
        #endregion

        #region # 批量提交审核作业计划 —— void SubmitExecutionPlans(IEnumerable<Guid>...
        /// <summary>
        /// 批量提交审核作业计划
        /// </summary>
        /// <param name="executionPlanIds">作业计划Id集</param>
        [HttpPost]
        [WrapPostParameters]
        public void SubmitExecutionPlans(IEnumerable<Guid> executionPlanIds)
        {
            this._planContract.SubmitExecutionPlans(executionPlanIds);
        }
        #endregion

        #region # 审核作业计划 —— void CheckExecutionPlan(Guid executionPlanId...
        /// <summary>
        /// 审核作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="passed">是否通过</param>
        /// <param name="checkedRemark">审核意见</param>
        [HttpPost]
        [WrapPostParameters]
        public void CheckExecutionPlan(Guid executionPlanId, bool passed, string checkedRemark)
        {
            this._planContract.CheckExecutionPlan(executionPlanId, passed, checkedRemark);
        }
        #endregion

        #region # 发布作业计划 —— void ReleaseExecutionPlan(Guid executionPlanId)
        /// <summary>
        /// 发布作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void ReleaseExecutionPlan(Guid executionPlanId)
        {
            this._planContract.ReleaseExecutionPlan(executionPlanId);
        }
        #endregion

        #region # 取消作业计划 —— void CancelExecutionPlan(Guid executionPlanId...
        /// <summary>
        /// 取消作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="reason">取消原因</param>
        [HttpPost]
        [WrapPostParameters]
        public void CancelExecutionPlan(Guid executionPlanId, string reason)
        {
            this._planContract.CancelExecutionPlan(executionPlanId, reason);
        }
        #endregion

        #region # 执行作业计划 —— void ExecuteExecutionPlan(Guid executionPlanId)
        /// <summary>
        /// 执行作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void ExecuteExecutionPlan(Guid executionPlanId)
        {
            this._planContract.ExecuteExecutionPlan(executionPlanId);
        }
        #endregion

        #region # 中止作业计划 —— void AbortExecutionPlan(Guid executionPlanId...
        /// <summary>
        /// 中止作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <param name="reason">中止原因</param>
        [HttpPost]
        [WrapPostParameters]
        public void AbortExecutionPlan(Guid executionPlanId, string reason)
        {
            this._planContract.AbortExecutionPlan(executionPlanId, reason);
        }
        #endregion

        #region # 完成作业计划 —— void CompleteExecutionPlan(Guid executionPlanId)
        /// <summary>
        /// 完成作业计划
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        [HttpPost]
        [WrapPostParameters]
        public void CompleteExecutionPlan(Guid executionPlanId)
        {
            this._planContract.CompleteExecutionPlan(executionPlanId);
        }
        #endregion


        //查询部分

        #region # 分页获取销售订单列表 —— PageModel<SaleOrderInfo> GetSaleOrdersByPage(string keywords...
        /// <summary>
        /// 分页获取销售订单列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="customerId">客户Id</param>
        /// <param name="issuedDate">下单日期</param>
        /// <param name="deliveryDate">交付日期</param>
        /// <param name="checkStatus">审核状态</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <returns>销售订单列表</returns>
        [HttpGet]
        public PageModel<SaleOrderInfo> GetSaleOrdersByPage(string keywords, Guid? customerId, DateTime? issuedDate, DateTime? deliveryDate, CheckStatus? checkStatus, DateTime? startTime, DateTime? endTime, int pageIndex, int pageSize)
        {
            return this._planContract.GetSaleOrdersByPage(keywords, customerId, issuedDate, deliveryDate, checkStatus,
                startTime, endTime, pageIndex, pageSize);
        }
        #endregion

        #region # 获取销售订单明细列表 —— IEnumerable<SaleOrderDetailInfo> GetSaleOrderDetails(Guid saleOrderId)
        /// <summary>
        /// 获取销售订单明细列表
        /// </summary>
        /// <param name="saleOrderId">销售订单Id</param>
        /// <returns>销售订单明细列表</returns>
        [HttpGet]
        public IEnumerable<SaleOrderDetailInfo> GetSaleOrderDetails(Guid saleOrderId)
        {
            return this._planContract.GetSaleOrderDetails(saleOrderId);
        }
        #endregion

        #region # 分页获取生产计划列表 —— PageModel<ProductionPlanInfo> GetProductionPlansByPage(string keywords...
        /// <summary>
        /// 分页获取生产计划列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="productId">产品Id</param>
        /// <param name="bomId">物料清单Id</param>
        /// <param name="saleOrderId">销售订单Id</param>
        /// <param name="status">生产计划状态</param>
        /// <param name="checkStatus">审核状态</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <returns>生产计划列表</returns>
        [HttpGet]
        public PageModel<ProductionPlanInfo> GetProductionPlansByPage(string keywords, Guid? productId, Guid? bomId, Guid? saleOrderId, ProductionPlanStatus? status, CheckStatus? checkStatus, DateTime? startTime, DateTime? endTime, Guid? facilityId, int pageIndex, int pageSize)
        {
            return this._planContract.GetProductionPlansByPage(keywords, productId, bomId, saleOrderId, status, checkStatus, startTime, endTime, facilityId, pageIndex, pageSize);
        }
        #endregion

        #region # 获取生产物料需求仓储接口 —— IEnumerable<ProductionMaterialAskInfo> GetProductionMaterialAsks(...
        /// <summary>
        /// 获取生产物料需求仓储接口
        /// </summary>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <returns>生产物料需求列表</returns>
        [HttpGet]
        public IEnumerable<ProductionMaterialAskInfo> GetProductionMaterialAsks(Guid productionPlanId)
        {
            return this._planContract.GetProductionMaterialAsks(productionPlanId);
        }
        #endregion

        #region # 分页获取作业计划列表 —— PageModel<ExecutionPlanInfo> GetExecutionPlansByPage(string keywords...
        /// <summary>
        /// 分页获取作业计划列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="productId">产品Id</param>
        /// <param name="processId">工艺Id</param>
        /// <param name="bomId">物料清单Id</param>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="status">作业计划状态</param>
        /// <param name="checkStatus">审核状态</param>
        /// <param name="hasGeneratedWorkOrders">是否已生成工单</param>
        /// <param name="hasInspected">是否已质检</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <returns>作业计划列表</returns>
        [HttpGet]
        public PageModel<ExecutionPlanInfo> GetExecutionPlansByPage(string keywords, Guid? productId, Guid? processId, Guid? bomId, Guid? productionPlanId, ExecutionPlanStatus? status, CheckStatus? checkStatus, bool? hasGeneratedWorkOrders, bool? hasInspected, DateTime? startTime, DateTime? endTime, Guid? facilityId, int pageIndex, int pageSize)
        {
            return this._planContract.GetExecutionPlansByPage(keywords, productId, processId, bomId, productionPlanId, status, checkStatus, hasGeneratedWorkOrders, hasInspected, startTime, endTime, facilityId, pageIndex, pageSize);
        }
        #endregion

        #region # 获取作业物料需求仓储接口 —— IEnumerable<ExecutionMaterialAskInfo> GetExecutionMaterialAsks(...
        /// <summary>
        /// 获取作业物料需求仓储接口
        /// </summary>
        /// <param name="executionPlanId">作业计划Id</param>
        /// <returns>作业物料需求列表</returns>
        [HttpGet]
        public IEnumerable<ExecutionMaterialAskInfo> GetExecutionMaterialAsks(Guid executionPlanId)
        {
            return this._planContract.GetExecutionMaterialAsks(executionPlanId);
        }
        #endregion
    }
}
